package ui.view;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.custom.ViewForm;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;

import operation.Message;

import org.eclipse.swt.widgets.CoolBar;
import org.eclipse.swt.widgets.CoolItem;
import org.eclipse.swt.custom.TableCursor;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;

public class TomcatManageUiPart extends Composite {
	private Text text;
	private Text text_1;
	private Text text_2;
	private Table tomcatlist;
	private Text consoleLog;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public TomcatManageUiPart(Composite parent, int style) {
		super(parent, style);
		RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
		rowLayout.fill = true;
		rowLayout.wrap = false;
		setLayout(rowLayout);
		
		Composite addComposite = new Composite(this, SWT.NONE);
		addComposite.setLayout(new GridLayout(8, false));
		
		Label lblNewLabel = new Label(addComposite, SWT.NONE);
		lblNewLabel.setText("serverip");
		
		text = new Text(addComposite, SWT.BORDER);
		text.setBounds(0, 0, 73, 23);
		
		Label lblNewLabel_3 = new Label(addComposite, SWT.NONE);
		lblNewLabel_3.setBounds(0, 0, 61, 17);
		lblNewLabel_3.setText("username");
		
		text_1 = new Text(addComposite, SWT.BORDER);
		text_1.setBounds(0, 0, 73, 23);
		
		Label lblNewLabel_4 = new Label(addComposite, SWT.NONE);
		lblNewLabel_4.setText("password");
		
		text_2 = new Text(addComposite, SWT.BORDER | SWT.PASSWORD);
		
		Button btnNewButton = new Button(addComposite, SWT.NONE);
		btnNewButton.setText("Test");
		
		Button btnNewButton_1 = new Button(addComposite, SWT.NONE);
		btnNewButton_1.setText("Add");
		
		Composite loginComposite = new Composite(this, SWT.NONE);
		loginComposite.setLayout(new GridLayout(4, false));
		
		Label lblNewLabel_1 = new Label(loginComposite, SWT.NONE);
		lblNewLabel_1.setText("server");
		
		Combo combo = new Combo(loginComposite, SWT.NONE);
		
		Button btnNewButton_2 = new Button(loginComposite, SWT.NONE);
		btnNewButton_2.setText("login");
		
		Button btnNewButton_3 = new Button(loginComposite, SWT.NONE);
		btnNewButton_3.setText("Delete");
		
		Composite logoutComposite = new Composite(this, SWT.NONE);
		logoutComposite.setLayout(new GridLayout(3, false));
		
		Label lblNewLabel_2 = new Label(logoutComposite, SWT.NONE);
		lblNewLabel_2.setText("serverip : %s  username : %s");
		
		Button btnNewButton_4 = new Button(logoutComposite, SWT.NONE);
		btnNewButton_4.setText("refresh");
		
		Button btnNewButton_5 = new Button(logoutComposite, SWT.NONE);
		btnNewButton_5.setText("loginout");
		
		Composite indexComposite = new Composite(this, SWT.NONE);
		indexComposite.setLayoutData(new RowData(SWT.DEFAULT, 142));
		indexComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
		
		ViewForm viewForm = new ViewForm(indexComposite, SWT.NONE);
		
		ToolBar toolBar = new ToolBar(viewForm, SWT.FLAT | SWT.RIGHT);
		viewForm.setTopLeft(toolBar);
		
		ToolItem tltmCheckItem = new ToolItem(toolBar, SWT.CHECK);
		tltmCheckItem.setSelection(true);
		tltmCheckItem.setText("sudo");
		
		ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
		
		ToolItem tltmNewItem = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem.setText("refresh");                                  
		
		ToolItem tltmNewItem_1 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_1.setText("startup");
		
		ToolItem tltmNewItem_2 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_2.setText("restart");
		
		ToolItem tltmNewItem_3 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_3.setText("shutdown");
		
		ToolItem tltmNewItem_4 = new ToolItem(toolBar, SWT.NONE);
		tltmNewItem_4.setText("upload");
		
		tomcatlist = new Table(viewForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
		tomcatlist.setLinesVisible(true);
		tomcatlist.setHeaderVisible(true);
		viewForm.setContent(tomcatlist);
		
		TableColumn tblclmnNewColumn = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn.setWidth(30);
		tblclmnNewColumn.setText(Message.TOM_MNG_TAB_ID);
		
		TableColumn tblclmnNewColumn_1 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_1.setWidth(55);
		tblclmnNewColumn_1.setText(Message.TOM_MNG_TAB_PROCESSID);
		
		TableColumn tblclmnNewColumn_2 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_2.setWidth(60);
		tblclmnNewColumn_2.setText(Message.TOM_MNG_TAB_RUNUSER);
		
		TableColumn tblclmnNewColumn_3 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_3.setWidth(200);
		tblclmnNewColumn_3.setText(Message.TOM_MNG_TAB_BASEPATH);
		
		TableColumn tblclmnNewColumn_4 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_4.setWidth(36);
		tblclmnNewColumn_4.setText(Message.TOM_MNG_TAB_AUTHOR);
		
		TableColumn tblclmnNewColumn_5 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_5.setWidth(48);
		tblclmnNewColumn_5.setText(Message.TOM_MNG_TAB_AUTHORGROUP);
		
		TableColumn tblclmnNewColumn_6 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_6.setWidth(60);
		tblclmnNewColumn_6.setText(Message.TOM_MNG_TAB_OPERASTATUS);
		
		TableColumn tblclmnNewColumn_7 = new TableColumn(tomcatlist, SWT.NONE);
		tblclmnNewColumn_7.setWidth(36);
		tblclmnNewColumn_7.setText(Message.TOM_MNG_TAB_OPERATION);
		
		Composite consoleComposite = new Composite(this, SWT.NONE);
		consoleComposite.setLayoutData(new RowData(SWT.DEFAULT, 100));
		consoleComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
		
		consoleLog = new Text(consoleComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);

	}

	@Override
	protected void checkSubclass() {
	}
}
